]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageTray: Only destroy policy after emitting ::destroy
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 25 Mar 2020 22:49:58 +0000 (23:49 +0100)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 26 Mar 2020 18:45:45 +0000 (18:45 +0000)
Destroying the policy invalidates it, so accessing it from a
Source::destroy handler (for example to disconnect signal
handlers) currently results in warnings like:

Object .Gjs_ui_messageTray_NotificationApplicationPolicy
(0x7f8c7c0a64a0), has been already deallocated — impossible
to access it.

https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2238

js/ui/messageTray.js

index 6f03968e9e060b708b9772e14130a75008b3032c..f949345be5827886d7bbaed11e4355f05c55819f 100644 (file)
@@ -880,8 +880,6 @@ var Source = GObject.registerClass({
     }
 
     destroy(reason) {
-        this.policy.destroy();
-
         let notifications = this.notifications;
         this.notifications = [];
 
@@ -890,6 +888,7 @@ var Source = GObject.registerClass({
 
         this.emit('destroy', reason);
 
+        this.policy.destroy();
         this.run_dispose();
     }